<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<!-- Claudio Herreros, Dylan James, Tyler Berg -->

	<head>
		<link rel="stylesheet" type="text/css" href="styles.css" title="Style 1"/>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Login</title>
		<script type="text/javascript">
		function checkFields(form)
		{
			if (form.UserName.value == "")
			{
				alert("Please enter your User Name.");
				form.UserName.focus();
				return false;
			}
	
			if (form.Password.value == "")
			{
				alert("Please enter a password.");
				form.Password.focus();
				return false;
			}
			
			return true;
		}
		</script>
	</head>
	
	<body>
		<h1>Login</h1>
		<hr/>
				<%
					if (request.getAttribute("errorMessage") != null)
					{
				%>
						<div style="color:red" align="center"> <strong>
						<%= request.getAttribute("errorMessage") %>
						</strong></div> <br />
				<%
						request.removeAttribute("errorMessage");
					}
				%>
		<form action="/SignIn" method="post">
		    <table align="center"  border="0" cellspacing="0" cellpadding="5" onsubmit="return checkFields(this);">
			    <tr>
			    <td class="FieldLabel">User Name: </td>
			    <td><input name="UserName" type="text" value="" size="40" /></td>
			    </tr>
			    <tr>
			    <td class="FieldLabel">Password:</td>
			    <td><input name="Password" type="password" value="" size="40" /></td>
			    </tr>
		    </table>
		<div align="center"><input type="submit" value="Log In" /></div>
		</form>
		<hr/>
		<a href="index.html">Back!</a>
	</body>
</html>
